function newq=mergePartQF(q, top, left, s, qf_b, qf_s)
    sq = idct2(s,8,8).*qf_s+128;
    bq0 = idct2(q(1:8,1:8).*qf_b,8,8);
    bq1 = idct2(q(1:8,9:16).*qf_b,8,8);
    bq2 = idct2(q(9:16,1:8).*qf_b,8,8);
    bq3 = idct2(q(9:16,9:16).*qf_b,8,8);
    bq = [bq0,bq1;bq2,bq3]+128;
    bq(top:top+7,left:left+7) = sq;
    q0=dct2(bq(1:8,1:8)-128,8,8)./qf_b;
    q1=dct2(bq(1:8,9:16)-128,8,8)./qf_b;
    q2=dct2(bq(9:16,1:8)-128,8,8)./qf_b;
    q3=dct2(bq(9:16,9:16)-128,8,8)./qf_b;
    newq = [q0, q1; q2, q3];
end
